<div class="widget">
    <div class="widgetTitle">
        <h3>Dashboard</h3>
    </div>

    <div class="widgetContent bottom-border">
        <div class="row nomargin">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>Title</th>
                        <th>Settings</th>
                        <th> Status</th>
                        <th>Hits</th>
                    </tr>
                    </thead>
                    <tbody>

                    <?php foreach($posts as $post):?>

                        <?php if(Commoncall::validate_post_data($post->id)){ ?>
                        <tr>
                        <td><?= $post->id;?></td>
                        <td><a href="<?= URL::base();?>/<?= Commoncall::postLink($post->id);?>" target="_blank"> <?= $post->title;?> </a></td>
                       
                        <td>
                            <div class="btn-group btn-group-xs">
                                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                    Menu
                                    <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu" role="menu">
                                    <li><a href="<?= URL::base();?>/member/post/edit/<?=$post->id;?>/1">Edit </a></li>
                                    <li><a href="<?= URL::base();?>/member/post/photo/<?= $post->id;?>">Gallery</a></li>
                                    <li class="divider"></li>
                                    <li><a href="<?= URL::base();?>/member/post/delete/<?= $post->id;?>" <?php if(Config::get('application.mode')){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" 
                                        <?}else{?>onclick="return confirm('Are you sure ?');"<?php }?>>Delete</a></li>
                                    <li><a href="<?= URL::base();?>/products/all/<?= $post->id;?>">Products</a></li>
                                </ul>
                            </div>
                        </td>
                         <td>
                      <?php if($post->status == "51") echo " <span class='badge'>ACTIVE</span>";?>
                      <?php if($post->status == "1") echo "<span class='badge'>INACTIVE</span>";?>
                        </td>
                        <td><span class="badge"><?= $post->hit;?></span></td>
                    </tr>
                        <?php }?>
                    <?php endforeach;?>

                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>